# tap.showShareboard(Object object)
以 Promise 风格调用:不支持
最低版本:1.7.0
# 功能描述
展示分享面板
注意:此方法的回调是拉起面板的回调,并非分享成功或失败的回调,分享行为的回调使用 tap.onShareMessage(function listener)
# 参数
# Object object
属性 | 类型 | 默认值 | 必填 | 说明 |
templateId | string | 是 | 分享模板id,必传 | |
sceneParam | string | 否 | 分享场景参数,用户打开分享卡片会将这个参数透传到小游戏 | |
success | function | 否 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
# success
、 fail
和 complete
回调函数
# 参数
# Object res
属性 | 类型 | 说明 |
errMsg | String | 错误信息 |
errno | Number | errno 错误码,错误码的详细说明参考 Errno错误码 |
# 示例代码
// 唤起分享面板
tap.showShareboard(
templateId: "模版ID",
sceneParam: "透传参数",
success: function (res) {
console.log(res.errMsg);
},
fail: function (res) {
console.log(res.errNo, res.errMsg);
},
complete: function (res) {
}
);